import { SD_SYSTEM } from "@src/globalData/enum";
import { createSpotMarketAllReqLoopThrottle } from "./spotMarketReq"
import { createSpotMarketZcqAllReqLoopThrottle } from "./spotMarketZcqReq";

/**
 * 设置对应系统的爬虫请求
 * @param headers 对应系统爬虫的请求的headers参数
 * @param mark 系统的唯一标记
 * @param unitid 机组id 现货市场系统的部分接口需要这个参数
 * @returns 
 */
export const setSpotMarketSystemRequest = (headers:HeadersInit, mark:string, unitid?:string) => {
  if(!mark) return
  
  console.log('setSpotMarketSystemRequest', mark)
  switch(mark) {
    // 现货市场 系统
    case SD_SYSTEM.SPOT_MARKET:
      createSpotMarketAllReqLoopThrottle(headers, unitid);
    break;
    // 现货市场中长期 系统
    case SD_SYSTEM.SPOT_MARKET_ZCQ:
      createSpotMarketZcqAllReqLoopThrottle(headers, unitid);
    break;
    default:
      break;
  }
}